using System;
using bitzhuwei.Compiler;

namespace bitzhuwei.GLSLFormat {
    /// <summary>
    /// Correspond to the Vn node function_declarator in the grammar(GLSL).
    /// </summary>
    internal partial class Vnfunction_declarator : IFullFormat {
        // [100] function_declarator = function_header ;
        // [101] function_declarator = function_header_with_parameters ;


        private readonly IFullFormat complex;

        private readonly TokenRange _scope;
        public TokenRange Scope => _scope;
        public void FullFormat(BlankConfig? preConfig, TextWriter writer, FormatContext context) {
            context.PrintBlanksAnd(this.complex, preConfig, writer);
        }


        // [100] function_declarator = function_header ;
        public Vnfunction_declarator(Vnfunction_header r0) {
            this.complex = new complex0(r0);
            this._scope = new TokenRange(r0);
        }
        class complex0 : IFullFormat {
            private readonly TokenRange _scope;
            public TokenRange Scope => _scope;
            public void FullFormat(BlankConfig? preConfig, TextWriter writer, FormatContext context) {
                context.PrintBlanksAnd(r0, preConfig, writer);
            }
            public readonly Vnfunction_header r0;
            public complex0(Vnfunction_header r0) {
                this.r0 = r0;
                this._scope = new TokenRange(r0);
            }
        }

        // [101] function_declarator = function_header_with_parameters ;
        public Vnfunction_declarator(Vnfunction_header_with_parameters r0) {
            this.complex = new complex1(r0);
            this._scope = new TokenRange(r0);
        }
        class complex1 : IFullFormat {
            private readonly TokenRange _scope;
            public TokenRange Scope => _scope;
            public void FullFormat(BlankConfig? preConfig, TextWriter writer, FormatContext context) {
                context.PrintBlanksAnd(r0, preConfig, writer);
            }
            public readonly Vnfunction_header_with_parameters r0;
            public complex1(Vnfunction_header_with_parameters r0) {
                this.r0 = r0;
                this._scope = new TokenRange(r0);
            }
        }



    }
}
